package com.helper.utils

import java.math.BigDecimal

object IsEmpty {
    /**
     * 判断是否为空
     *
     * @param object
     * @return
     */
    fun check(`object`: List<*>?): Boolean {
        return null == `object` || `object`.size == 0
    }

    fun check(`object`: Set<*>?): Boolean {
        return null == `object` || `object`.size == 0
    }

    fun check(`object`: String?): Boolean {
        return null == `object` || `object`.trim { it <= ' ' }.length == 0 || "" == `object`
    }

    fun check(`object`: Array<Any>?): Boolean {
        return null == `object` || `object`.size == 0
    }

    fun check(`object`: Any?): Boolean {
        return null == `object`
    }

    fun check(bigDecimal: BigDecimal?): Boolean {
        return null == bigDecimal || bigDecimal.toDouble() == 0.0
    }
}